function pageloaded(title, pageno, color) {
	parent.Ext.getCmp("title").setTitle(title, 'title');
	parent.document.getElementById('top_head_text').innerHTML = '<span style="font-size:14px; color:'+color+'; font-weight:bold;">'+title+'</span><span style="font-size:14px; color:#B1B3B6; font-family:arial;">'+pageno+'</span>';
	setTimeout(function() {
		parent.document.getElementById('loading_effect').style.display = "none";
	}, 200);
	if (parent.document.getElementById('main').style.display != 'none') {
		parent.document.getElementById('main').style.display = "none";
		parent.document.getElementById('inner_main').style.display = "block";
	} else {
		parent.document.getElementById('inner_main').style.display = "none";
		parent.document.getElementById('main').style.display = "block";
	}
}
var messageLoadTimer ;
function messageloaded(msg) {
	msg = msg || '' ;
	parent.document.getElementById('top_head_msg').innerHTML = msg||'&nbsp;';
	if( messageLoadTimer ){
		clearTimeout(messageLoadTimer);// 清除上次的定时器、避免短时间内显示两条消息时后一条消息显示时间过短
	}
	messageLoadTimer = setTimeout(function() {
		parent.document.getElementById('top_head_msg').innerHTML = '&nbsp;';
	}, 170*msg.length + 1);
}

//prepare loading
function prepareload(loca){
	var href = loca;
	if (typeof(isAir) != 'undefined' && isAir)
	{
		if (loca.substring(0, 1) == '/')
			href = loca.substring(1, loca.length);
		else
			href = loca;
		if (document.getElementsByTagName('base').length == 0)
			href = "http://iscm.wecoo.com/air/" + href;
	} 
	window.location.href = href;
};
function confirmprepareload(string,confirm){
	if(confirm)
	parent.top.Ext.Msg.show({
			title : '确定离开?',
			msg : '您将离开的当前页面有未保存的修改信息,您确定离开吗?',
			buttons : Ext.Msg.YESNOCANCEL,
			fn : function(btn){if(btn == 'yes') prepareload(string) },
			icon : Ext.MessageBox.QUESTION
		});
	else
		prepareload(string);
}
